package pack1

import (
	"fmt"
	"strconv"
)

type Base struct{}

func (Base) Magic() {
	fmt.Println("base magic")
}

func (self Base) MoreMagic() {
	self.Magic()
	self.Magic()
}

type Voodoo struct {
	Base
}

func (Voodoo) Magic() {
	fmt.Println("voodoo magic")
}

func (*Voodoo) String() string{
	return "VoodooStringMethod"
}

type TowInts struct {
	x int
	y int
}

func (t *TowInts) String() string {
	return "(" + strconv.Itoa(t.x) + "/" + strconv.Itoa(t.y) + ")"
}

func TestMagic() {
	//v := new(Voodoo)
	//v.Magic()
	//v.MoreMagic()
	//
	//fmt.Println(v)

	ti := new(TowInts)
	ti.x = 1
	ti.y = 2

	fmt.Printf("TowInts: %v\n", ti)
	fmt.Printf("TowInts type: %T\n", ti)
	fmt.Printf("TowInts: %#v\n", ti)
	fmt.Println("TowInts:", ti)
}
